package com.fcgzs.springboot.cfg;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//WebMvcConfigurer接口：可以扩展springboot功能
@Configuration
public class MyAutoConfig implements WebMvcConfigurer {

    //将本地文件夹挂载到服务器(虚拟路径)的方法
    //addResourceHandler参数：虚拟路径
    //addResourceLocations参数：本地路径
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/setmealpic/**").addResourceLocations("file:E:/缓存区/上传路径/upload/");
    }
}
